package com.zztt.logmask.common.factory;

import com.zztt.logmask.common.handle.MaskHandle;

import java.util.ArrayList;
import java.util.List;

/**
 * 默认的掩码处理器的工厂类
 */
public class DefaultMaskHandleFactory implements MaskHandleFactory{

    private DefaultMaskHandleFactory(){ }

    public static MaskHandleFactory getInstance(){
        return InnerDefaultMaskHandleFactory.MASK_HANDLE_FACTORY;
    }

    static class InnerDefaultMaskHandleFactory{
        public static final MaskHandleFactory MASK_HANDLE_FACTORY = new DefaultMaskHandleFactory();
    }

    private List<MaskHandle> maskHandles=new ArrayList<MaskHandle>(10);

    @Override
    public List<MaskHandle> getAllMaskHandle() {
        return maskHandles;
    }

    @Override
    public void registerMaskHandle(MaskHandle maskHandle) {
        maskHandles.add(maskHandle);
    }

}
